namespace S.O.Domain.Medical
{
    /// <summary>
    /// 医生排班模型
    /// 用于管理医生的工作时间安排，支持挂号时的时间段选择
    /// </summary>
    public class DoctorScheduleModel : BaseEntity
    {
        /// <summary>
        /// 医生ID
        /// </summary>
        public long DoctorId { get; set; }
        
        /// <summary>
        /// 医生姓名
        /// </summary>
        public string DoctorName { get; set; } = string.Empty;
        
        /// <summary>
        /// 科室
        /// </summary>
        public string Department { get; set; } = string.Empty;
        
        /// <summary>
        /// 排班日期
        /// </summary>
        public DateTime ScheduleDate { get; set; }
        
        /// <summary>
        /// 时间段（上午、下午、晚上）
        /// </summary>
        public string TimeSlot { get; set; } = string.Empty;
        
        /// <summary>
        /// 开始时间
        /// </summary>
        public TimeSpan StartTime { get; set; }
        
        /// <summary>
        /// 结束时间
        /// </summary>
        public TimeSpan EndTime { get; set; }
        
        /// <summary>
        /// 最大挂号数量
        /// </summary>
        public int MaxRegistrations { get; set; } = 20;
        
        /// <summary>
        /// 已挂号数量
        /// </summary>
        public int CurrentRegistrations { get; set; } = 0;
        
        /// <summary>
        /// 排班状态（正常、停诊、满号）
        /// </summary>
        public string Status { get; set; } = "正常";
        
        /// <summary>
        /// 备注信息
        /// </summary>
        public string Remarks { get; set; } = string.Empty;
        
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; } = true;
        
        /// <summary>
        /// 是否还有号源
        /// </summary>
        public bool HasAvailableSlots => CurrentRegistrations < MaxRegistrations && Status == "正常" && IsEnable;
    }
}